const typescript = require('@rollup/plugin-typescript');
const fs = require('fs');
// 判断dist文件是否存在，存在则删除
if (fs.existsSync('dist')) {
  fs.rmdirSync('dist', { recursive: true });
}


export default {
  input: 'src/index.ts',
  output: {
    file: 'dist/index.js',
    format: 'umd',
    name: 'Drawing',
  },
  plugins: [typescript({ module: 'ESNext' })],
};
